package cn.wolfcode.p2p.bussness.service.impl;

import cn.wolfcode.p2p.base.query.QueryObject;
import cn.wolfcode.p2p.bussness.domain.BidRequestAuditHistory;
import cn.wolfcode.p2p.bussness.mapper.BidRequestAuditHistoryMapper;
import cn.wolfcode.p2p.bussness.service.IBidRequestAuditHistoryService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class BidRequestAuditHistoryServiceImpl implements IBidRequestAuditHistoryService {

    @Autowired
    private BidRequestAuditHistoryMapper bidRequestAuditHistoryMapper;

    @Override
    public int save(BidRequestAuditHistory bidRequestAuditHistory) {
        return bidRequestAuditHistoryMapper.insert(bidRequestAuditHistory);
    }

    @Override
    public PageInfo queryList(QueryObject qo) {
        PageHelper.startPage(qo.getPageNum(), qo.getPageSize());
        List list = bidRequestAuditHistoryMapper.selectList(qo);
        return new PageInfo(list);
    }

    @Override
    public List queryListByBidRequestId(Long id) {
        return bidRequestAuditHistoryMapper.queryListByBidRequestId(id);
    }
}
